package gostd

// Mutex control stdin and stdout.
func Io() Toggle {
	return Toggle{
		Lock: func() {
			inMutex.Lock()
			outMutex.Lock()
		},
		TryLock: func() {
			inMutex.TryLock()
			outMutex.TryLock()
		},
		Unlock: func() {
			inMutex.Unlock()
			outMutex.Unlock()
		},
	}
}
